package com.gy.paidao.main.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.mapdemo.R;
import com.gy.paidao.main.bean.MyLocationBean;

import java.util.List;

/**
 * @author GY
 * @date 16/4/21
 * @Description:选择地址adapter
 */
public class SearchAdapter extends BaseAdapter {

    private Context context;
    private List<MyLocationBean> list;

    public SearchAdapter(Context context,List<MyLocationBean> list){
        this.context = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        convertView = View.inflate(context, R.layout.adapter_mapsearch,null);
        TextView tv = (TextView) convertView.findViewById(R.id.adapter_search_map_tv_title);
        tv.setText(list.get(position).name+"");
        return convertView;
    }
}
